$(function() {
  $('a.delete').click(function() {
    var that = $(this);
    var data = {'product_id':''};
    data.product_id = $(this).attr('data-product-id');
    $.post('/product/delete/', data, function(ret) {
      if (ret.code == code.succ) {
        that.parent().parent().fadeOut('slow');
      } else {
        alert('操作失败');
      }
    }, 'json');
  });
});
